package com.cskaoyan.converter;

import com.cskaoyan.bean.User;
import org.springframework.core.convert.converter.Converter;

/**
 * two → to
 * @author stone
 * @date 2022/09/03 11:50
 */
public class String2UserConverter implements Converter<String, User> {
    @Override
    public User convert(String s) {
        //在里面做业务处理
        User user = new User();
        user.setUsername(s);
        user.setPassword("123456");
        return user;
    }
}
